/*
 * Navigator.java
 *
 * Created on November 29, 2007, 2:30 PM
 */

package edu.olin.maps.ui;

import edu.olin.maps.graph.Path;
import edu.olin.maps.graph.generator.RandomGraphGenerator;
import edu.olin.maps.graph.shortestpath.DijkstraSolver;
import edu.olin.maps.graph.shortestpath.SpaceGraphSolver;
import edu.olin.maps.graph.weighted.space.SpaceGraph;
import edu.olin.maps.graph.weighted.space.SpaceVertex;
import javax.swing.UIManager;

/**
 *
 * @author  tmichon
 */
public class Navigator extends javax.swing.JFrame {
	
	/** Creates new form Navigator */
	public Navigator() {
		initComponents();
	}
	
	private void setGraph(SpaceGraph g) {
		this.blueprint.setGraph(g);
	}
	
	private void setPath(Path p) {
		this.blueprint.setPath(p);
	}
	
	private static void runNavigator() {
		int n = 25;
		Navigator nav = new Navigator();
		SpaceGraph g = RandomGraphGenerator.generateRandomSpaceGraph(n, 3 * n);
		
		//System.out.println("Graph: " + g);
		nav.setGraph(g);
		nav.setVisible(true);
	}
	
	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        blueprint = new edu.olin.maps.ui.Blueprint();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Olin Navigator");
        getContentPane().add(blueprint, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents
	
	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		//System.setProperty("sun.java2d.opengl", "true");
		//System.setProperty("sun.java2d.noddraw", "true");
		java.awt.Toolkit.getDefaultToolkit().setDynamicLayout(true);
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			return;
		}
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				runNavigator();
			}
		});
	}
	
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private edu.olin.maps.ui.Blueprint blueprint;
    // End of variables declaration//GEN-END:variables
	
}
